package com.fy.dao;

import com.fy.entity.Video;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ViedoMapper {
    @Select("select *from video")
    List<Video> findAll();

    @Select("select *from video where  video_id=#{video_id}")
    List<Video> getInfo(@Param("video_id") String video_id);

    @Insert("insert into video(video_id, video_url, info_id, video_title, video_like, video_pic, video_collection, video_state) VALUES(#{video_id},#{video_url},#{info_id},#{video_title},#{video_like},#{video_pic},#{video_collection},#{video_state})")
    int insert(@Param("video_id") String video_id, @Param("video_url") String video_url,
               @Param("info_id") String info_id, @Param("video_title") String video_title,
               @Param("video_like") String video_like, @Param("video_pic") String video_pic,
               @Param("video_collection") String video_collection, @Param("video_state") String video_state);

    @Update("update video set video_like=#{video_like},video_collection=#{video_collection} where video_id=#{video_id}")
    int update(@Param("video_id") String video_id, @Param("video_like") int video_like,
               @Param("video_collection") int video_collection);
}
